import { Toast } from 'vant'
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {
    path:'/login',
    name:'login',
    component:()=>import('@/views/login.vue'),
    meta:{
      showNav:true
    }
  },
  {
    path:'/home',
    name:'home',
    component:()=>import('@/views/home.vue')
  },
  {
    path:'/manage',
    name:'manage',
    redirect:'/manage/article',
    component:()=>import('@/views/manage.vue'),
    children:[
      {
        path:'article',
        component:()=>import('@/components/article.vue'),
      },
      {
        path:'user',
        component:()=>import('@/components/user.vue'),
      }
    ]
  },
  {
    path:'/user',
    name:'user',
    component:()=>import('@/views/user.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
